<?php
require_once dirname(__FILE__) . '/../includes/common.inc.php';
require_once dirname(__FILE__) . '/../includes/pdoorm.inc.php';

header('Content-Type: text/plain');
die;
$sql="
    insert into ns_v1purchaseitemselect
    SELECT NULL,a.trackId,a.title,a.`value`,ifnull(b.oid_a,0) AS purchaseitem_id  FROM ns_purchaseitemselect AS a LEFT JOIN ns__ez_relation_purchaseitem_purchaseitemselect AS b
ON a.e_oid = b.oid_b
";

sql_execute($sql);
